﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucShoppingCart.ascx.cs" Inherits="MyWeb.TrangChinh.UC.ucShoppingCart" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<link href="../Style/StyleShoppingCart.css" rel="stylesheet" />
<div id="content-main-header">
    GIỎ HÀNG CỦA BẠN
</div>
<div id="register">
   <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" Style="text-align: center" Width="100%" AllowPaging="True" DataKeyNames="id" OnRowCommand="gvData_RowCommand" ShowFooter="True" OnRowDataBound="gvData_RowDataBound">
        <Columns>
            <asp:TemplateField HeaderText="MÃ SẢN PHẨM">
                <HeaderStyle Width="15%"></HeaderStyle>
                <ItemTemplate>
                    <asp:HiddenField runat="server" ID="hdId" Value='<%#Eval("id") %>' />
                    <asp:Label ID="lblId" runat="server" Text='<%#Eval("id")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="name" HeaderText="TÊN SẢN PHẨM" />
            <asp:TemplateField HeaderText="GIÁ">
                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                <ItemTemplate>
                    <asp:Label ID="lblprice" runat="server" Text='<%#Format_Price(Eval("pricenew").ToString()) +" VNĐ"%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="SỐ LƯỢNG">
                <HeaderStyle Width="10%"></HeaderStyle>
                <ItemTemplate>
                    <asp:TextBox ID="txtquantity" Text='<%#Eval("quantity") %>' runat="server" Style="text-align: center" Width="60px"></asp:TextBox>
                    <asp:FilteredTextBoxExtender ID="txtQuantity_FilteredTextBoxExtender" runat="server" FilterType="Numbers" TargetControlID="txtquantity">
                    </asp:FilteredTextBoxExtender>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="THÀNH TIỀN">
                <HeaderStyle Width="20%"></HeaderStyle>
                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                <ItemTemplate>
                    <asp:Label ID="lbltotalmoney" Text='<%#Format_Price(Eval("totalmoney").ToString()) +" VNĐ"%>' runat="server"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="CHỨC NĂNG">
                <HeaderStyle Width="10%"></HeaderStyle>
                <ItemTemplate>
                    <asp:ImageButton ID="imgbtnCapnhat" CommandArgument='<%#Eval("id") %>' CommandName="Update" runat="server" ImageUrl="~/TrangChinh/Image/refresh.png" ToolTip="Cập nhật" />
                    |<asp:ImageButton ID="imgbtHuybo" CommandArgument='<%#Eval("id") %>' CommandName="Delete" runat="server" ImageUrl="~/TrangChinh/Image/delete.png" ToolTip="Hủy bỏ" Width="16px" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle BackColor="#FF95A6"></HeaderStyle>
        <FooterStyle BackColor="#FF95A6"></FooterStyle>
        <EmptyDataTemplate>
            <asp:Label ID="Label1" runat="server" Text="Giỏ hàng của bạn rỗng"></asp:Label>
        </EmptyDataTemplate>
    </asp:GridView>
    <table style="width: 100%">
        <tr>
            <td style="text-align: right">
                <asp:Label ID="Label2" Text="TỔNG TIỀN: " runat="server" Style="font-weight: 700"></asp:Label>
                <asp:Label ID="lblTongtien" runat="server" Style="font-weight: 700"></asp:Label>
                <asp:Label ID="Label3" runat="server" Text=" (VNĐ)" Style="font-weight: 700"></asp:Label>
            </td>
        </tr>
    </table>
    <br />
    <asp:Button runat="server" CssClass="button" ID="btnMuatiep" Text="MUA TIẾP" OnClick="btnMuatiep_Click" />
    <asp:Button runat="server" CssClass="button" ID="btnDathang" Text="MUA NGAY" OnClick="btnDathang_Click" />
</div>
